export const getOption = (self) => {
    return {
        height: 'calc(100vh - 480px)',
        calcHeight: 30,
        selectionList: [],
        tip: false,
        searchShow: true,
        // searchMenuSpan: 5,
        border: true,
        index: true,
        viewBtn: false,
        editBtn: false,
        delBtn: false,
        addBtn: false,
        indexLabel: '序号',
        columnBtn: false,
        selection: true,
        searchMenuSpan: 6,
        searchMenuPosition: 'right',
        column: [
            {
                label: '检验单号',
                prop: 'documentNo',
                searchValue: '',
                searchOrder: 6,
                type: 'search',
                search: true,
                appendClick: () => {
                    self.openDocumentNoModel();
                }
            },
            {
                label: '工单号',
                prop: 'sourceNo',
                type: 'search',
                searchOrder: 5,
                search: true,
                appendClick: () => {
                    self.openWorkOrderCommonModal('pageWorkOrderModal');
                }
            },
            {
                label: '客户名称',
                prop: 'partnerName',
                search: true,
                type: 'search',
                searchOrder: 2,
                appendClick: () => {
                    self.openPartnerModal();
                }
            },
            {
                label: '产品编码',
                prop: 'partNo',
                type: 'search',
                search: true,
                searchOrder: 1,
                appendClick: () => {
                    self.openPartModal();
                }
            },
            {
                label: '产品名称',
                prop: 'partName'
            },
            {
                label: '产品型号',
                prop: 'partModel',
                // search: true,
                // searchOrder: 2
            },
            {
                label: '产线',
                prop: 'lineName',
                search: true,
                type: 'select',
                searchOrder: 7,
                dicUrl: '/api/mes-product/productionline/list',
                props: {
                    label: 'name',
                    value: 'name'
                }
            },
            {
                label: '工单计划数量',
                prop: 'workOrderQuantity'
            },
            {
                label: '工单完工数量',
                prop: 'workOrderCompletedQuantity'
            },
            { label: '报检数量', prop: 'sendExamineQuantity' },
            {
                label: '是否加急',
                prop: 'isUrgent',
                search: true,
                searchOrder: 3,
                type: 'select',
                dicData: [
                    { label: '是', value: true },
                    { label: '否', value: false }
                ]
            },
            {
                label: '检验状态',
                prop: 'status',
                type: 'select',
                search: true,
                searchOrder: 4,
                dicData: [
                    { label: '未检验', value: 1 },
                    { label: '已检验', value: 2 },
                    { label: '待入库', value: 3 },
                    { label: '草稿', value: 4 },
                    { label: '超期关闭', value: 5 },
                    { label: '已撤销', value: 6 },
                ]
            },
            {
                label: '报检时间',
                prop: 'createTime'
            }
        ]
    };
};
export const revokeOption = {
    submitBtn: false,
    emptyBtn: false,
    labelWidth: 150,
    group: [
        {
            label: '撤销原因',
            prop: 'revoke',
            arrow: false,
            icon: 'el-icon-vertical-bar',
            column: [
                {
                    label: '撤销原因',
                    prop: 'revocation',
                    type: 'textarea',
                    span: 24,
                    maxRows: 3,
                    minRows: 3,
                    rules: [
                        {
                            required: true,
                            message: '请选择撤销原因',
                            trigger: 'blur'
                        }
                    ]
                }
            ]
        },
        {
            label: '基本信息',
            prop: 'basicInfo',
            arrow: false,
            icon: 'el-icon-vertical-bar',
            column: [
                {
                    label: '检验单号',
                    prop: 'documentNo',
                    disabled: true
                },
                {
                    label: '客户名称',
                    prop: 'partnerName',
                    disabled: true
                },
                {
                    label: '工单号',
                    prop: 'sourceNo',
                    disabled: true
                },
                // {
                //   label: '检验分类',
                //   prop: 'sourceType',
                //   type: 'select',
                //   props: {
                //     label: 'dictValue',
                //     value: 'dictKey'
                //   },
                //   dicUrl: '/api/blade-system/dict/dictionary?code=inspect_sub_type',
                //   disabled: true
                // },
                // {
                //     label: '产线',
                //     prop: 'lineName',
                //     disabled: true
                // },
                {
                    label: '产品编码',
                    prop: 'partNo',
                    disabled: true
                },
                {
                    label: '产品名称',
                    prop: 'partName',
                    disabled: true
                },
                {
                    label: '产品型号',
                    prop: 'partModel',
                    disabled: true
                },
                {
                    label: '产线',
                    prop: 'lineName',
                    disabled: true
                },
                {
                    label: '工单计划数量',
                    prop: 'workOrderQuantity',
                    disabled: true,
                },
                {
                    label: '工单完工数量',
                    prop: 'workOrderCompletedQuantity',
                    disabled: true,
                },
                {
                    label: '是否加急',
                    prop: 'isUrgent',
                    type: 'switch',
                    value: false,
                    dicData: [
                        {
                            label: '否',
                            value: false
                        },
                        {
                            label: '是',
                            value: true
                        }
                    ],
                    disabled: true
                }
            ]
        }
    ]
};

export const getAddOption = (self) => {
    return {
        submitBtn: false,
        emptyBtn: false,
        labelWidth: 150,
        column: [
            {
                label: '生产工单',
                prop: 'sourceNo',
                type: 'search',
                rules: [
                    {
                        required: true,
                        message: '请选择生产工单',
                        trigger: 'blur'
                    }
                ],
                appendClick: () => {
                    self.openWorkOrderCommonModal('addWorkOrderModal');
                }
            },
            {
                label: '工单计划数量',
                prop: 'workOrderQuantity',
                disabled: true
            },
            {
                label: '工单完工数量',
                prop: 'workOrderCompletedQuantity',
                disabled: true
            },
            {
                label: '客户名称',
                prop: 'partnerName',
                disabled: true
            },
            {
                label: '产品编码',
                prop: 'partNo',
                disabled: true
            },
            {
                label: '产品名称',
                prop: 'partName',
                disabled: true
            },
            {
                label: '产品型号',
                prop: 'partModel',
                disabled: true
            },
            {
                label: '产线',
                prop: 'lineId',
                type: 'select',
                dicData: [],
            },
            // {
            //   label: '检验分类',
            //   prop: 'sourceTypeName',
            //   type: 'select',
            //   disabled: true,
            //   value: '包装前'
            // },
            {
                label: '本次报检数量',
                prop: 'sendExamineQuantity',
                type: 'number',
                min: 0,
                rules: [
                    {
                        required: true,
                        message: '请输入本次报检数量',
                        trigger: 'blur'
                    }
                ]
            },
            {
                label: '是否加急',
                prop: 'isUrgent',
                type: 'switch',
                value: false,
                dicData: [
                    {
                        label: '否',
                        value: false
                    },
                    {
                        label: '是',
                        value: true
                    }
                ]
            }
        ]
    };
};
